Why should hashtable size be prime number?

Lets say our hashtable size is 100 (which is NOT a prime number). Say we wish to hash some value x and its multiples 2x, 3x, 4x and so on. If x was = 2 then {2, 4, 6, 8, .., inf} would be our values. Since our hashtable is of size 100, only 50% … Continue reading Why should hashtable size be prime number?